package com.vmj.instructions.comparisions;

import com.vmj.instructions.base.BranchInstruction;
import com.vmj.rtda.Frame;
import com.vmj.rtda.OperandStack;

/**
 * Created by yangshoujun on 2017/9/10 上午12:30.
 */
public class IfLe extends BranchInstruction {
    @Override
    public void execute(Frame frame) {
        OperandStack stack = frame.getOperandStack();
        int val = stack.popInt();
        if(val <= 0) {
            BranchInstruction.branch(frame, getOffset());
        }
    }
}
